<?php

global $_GPC, $_W;

$GLOBALS["\\146\\x72\\x61\\155\\x65\\x73"] = $this->getMainMenu();

$touorder = pdo_fetch(
    "\\x53\\x45\\114\\105\\103\\124\\x20\\x63\\x6f\\x75\\156\\x74\\x28\\52\\51\\40\\141\\163\\40\\163\\150\\x75\\x20\\x46\\122\\x4f\\x4d\\40\\151\\155\\x73\\137\\x6d\\145\\x69\\x6b\\145\\137\\x73\\x68\\157\\x70\\x5f\\x6f\\162\\144\\x65\\162\\40\\x77\\x68\\x65\\x72\\x65\\x20\\x6f\\162\\144\\x65\\x72\\x5f\\x73\\164\\x61\\164\\x75\\x73\\x3d\\x31\\40\\141\\x6e\\x64\\40\\165\\x6e\\x69\\x61\\143\\151\\144\\75" . $_W["\\x75\\156\\x69\\141\\143\\151\\x64"]
);

$toudistribution = pdo_fetch(
    "\\123\\x45\\x4c\\x45\\103\\x54\\40\\x63\\157\\x75\\156\\x74\\50\\x2a\\x29\\40\\x61\\163\\x20\\163\\150\\165\\40\\106\\122\\117\\115" . tablename(
        "\\x6d\\x65\\151\\x6b\\x65\\x5f\\163\\150\\x6f\\x70\\x5f\\x64\\151\\x73\\164\\x72\\151\\142\\x75\\x74\\157\\162\\163"
    ) . "\\x77\\150\\145\\162\\145\\x20\\165\\x6e\\x69\\141\\143\\x69\\x64\\x3d" . $_W["\\165\\x6e\\151\\141\\x63\\x69\\x64"] . "\\40\\x61\\156\\144\\x20\\163\\x74\\x61\\164\\145\\x3d\\60\\40"
);

$touwallet = pdo_fetch(
    "\\x53\\105\\114\\105\\103\\x54\\40\\x63\\x6f\\165\\156\\164\\x28\\x2a\\51\\40\\141\\x73\\x20\\163\\150\\165\\x20\\106\\122\\117\\x4d" . tablename(
        "\\155\\x65\\x69\\153\\x65\\x5f\\163\\150\\157\\x70\\x5f\\x77\\x61\\154\\154\\x65\\x74"
    ) . "\\x20\\167\\x68\\145\\162\\x65\\x20\\165\\x6e\\x69\\x61\\x63\\151\\x64\\75" . $_W["\\x75\\156\\x69\\141\\x63\\x69\\144"] . "\\x20\\141\\x6e\\144\\x20\\154\\141\\142\\x65\\x6c\\x3d\\62\\x20\\141\\x6e\\x64\\x20\\163\\164\\141\\164\\x75\\163\\x3d\\61\\40"
);

$sumtoubu = $touorder["\\163\\150\\x75"] + $toudistribution["\\163\\150\\x75"] + $touwallet["\\x73\\150\\165"];

$op = $_GPC["\\157\\x70"];

$ops = [
    "\\x64\\151\\x73\\160\\x6c\\141\\x79",
    "\\x70\\157\\x73\\164",
    "\\144\\145\\x6c\\145\\164\\145",
    "\\x6b\\x75\\x61\\x69\\x64\\x69"
];

$op = in_array($op, $ops) ? $op : "\\x64\\151\\163\\x70\\154\\x61\\171";

$withdr = pdo_get(
    "\\x6d\\x65\\151\\x6b\\x65\\x5f\\163\\x68\\x6f\\160\\137\\x72\\x65\\x6c\\x61\\171\\x73\\145\\164",
    [
        "\\x75\\x6e\\x69\\141\\x63\\x69\\144" => $_W["\\165\\156\\x69\\x61\\x63\\151\\x64"]
    ]
);

if (!checksubmit("\\x73\\165\\x62\\x6d\\x69\\x74")) {
    return include $this->template("\\167\\145\\x62\\x2f\\162\\145\\x6c\\141\\x79\\x73\\145\\164");
}

$data["\\x6e\\145\\167\\137\\145\\156\\166\\x65\\x6c\\157\\x70\\x65"] = $_GPC["\\156\\145\\x77\\x5f\\145\\x6e\\x76\\x65\\x6c\\x6f\\160\\x65"];

$data["\\160\\x74\\x5f\\x65\\156\\x76\\145\\154\\157\\x70\\145"] = $_GPC["\\160\\x74\\x5f\\145\\x6e\\x76\\145\\154\\x6f\\x70\\x65"];

$data["\\x73\\143\\157\\160\\x65"] = $_GPC["\\163\\143\\x6f\\x70\\x65"];

$data["\\x72\\x65\\x6c\\141\\171\\137\\x74\\151\\155\\x65\\x73"] = $_GPC["\\162\\x65\\154\\x61\\171\\x5f\\x74\\151\\x6d\\x65\\x73"];

$data["\\162\\145\\x6c\\x61\\171\\x5f\\144\\145\\163\\143"] = $_GPC["\\x72\\145\\x6c\\x61\\171\\137\\144\\x65\\163\\143"];

$data["\\170\\162\\137\\145\\x6e\\166\\x65\\x6c\\157\\160\\145"] = $_GPC["\\170\\162\\x5f\\x65\\156\\166\\x65\\154\\x6f\\160\\x65"];

$data["\\x74\\x69\\x6d\\145"] = $_GPC["\\x74\\x69\\155\\145"];

$data["\\x75\\x6e\\151\\x61\\x63\\151\\x64"] = $_W["\\165\\x6e\\151\\x61\\143\\151\\144"];

if (empty($withdr)) {
    $res = pdo_insert("\x6d\145\151\x6b\145\x5f\x73\150\x6f\x70\137\x72\x65\154\141\x79\x73\145\x74", $data);
    if (!empty($res)) {
        message("\xe6\267\xbb\xe5\212\xa0\346\x88\220\xe5\212\x9f\xef\xbc\x81", $this->createWebUrl("\x72\145\154\x61\171\163\145\164"), "\163\x75\143\143\145\163\163");
        return include $this->template("\167\145\x62\x2f\162\145\x6c\141\x79\x73\145\164");

    }
    message("\xe6\267\273\345\212\xa0\345\xa4\xb1\350\xb4\xa5\357\xbc\201", '', "\145\162\162\x6f\x72");
    include $this->template("\167\145\x62\x2f\162\145\x6c\141\x79\x73\145\164");
}

$res = pdo_update(
    "\\x6d\\145\\151\\x6b\\x65\\x5f\\x73\\150\\x6f\\x70\\x5f\\x72\\x65\\154\\x61\\171\\163\\145\\164",
    $data,
    [
        "\\x75\\156\\151\\141\\x63\\x69\\x64" => $_W["\\x75\\x6e\\151\\141\\143\\x69\\x64"]
    ]
);

if (!empty($res)) {
   message("\344\xbf\xae\xe6\224\xb9\346\x88\x90\xe5\212\237\xef\274\201", $this->createWebUrl("\x72\145\x6c\141\171\x73\145\x74"), "\x73\165\x63\143\145\163\x73");
   return include $this->template("\167\145\x62\x2f\162\145\x6c\141\x79\x73\145\164");

}

message(
    "\\346\\234\\xaa\\xe4\\277\\256\\346\\x94\\xb9\\xe4\\277\\xa1\\xe6\\x81\\257\\xe6\\x95\\xb0\\xe6\\215\\256\\357\\xbc\\201",
    "",
    "\\145\\x72\\x72\\x6f\\162"
);
include $this->template("\\167\\145\\x62\\x2f\\162\\145\\x6c\\141\\x79\\x73\\145\\164");
